home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / tex / meta27 / mfpandor.lzh / fontbl.tex < prev    next >
Text File  |  1990-11-16  |  7KB  |  174 lines

  1.  
  2. % The essential parts of this macro appeared in {\it TUGboat, Volume 3, No. 1}
  3. % in the note: "DISPLAY OF A FONT IN TABLE FORM." by Roger L. Beeman.
  4. % This version was rewritten by Pierre A. MacKay to take advantage of
  5. % the new features of \TeX82.  It is now interactive, and prompts the
  6. % user for a font name.  If the font is a text font, a sample paragraph
  7. % is set, which is justified to three times the lower-case alphabet length
  8. % if that will fit in the overall \hsize.  (If the font is a fixed-width
  9. % font such as "amtt", the sample is set with a ragged right margin.) 
  10. % The sample is leaded 20% over the stated point-size, so that a
  11. % 10-point font is set 10 on 12.  The length of both upper and lower
  12. % case alphabets is given, along with the height and depth of the
  13. % lower case alphabet and the height of the upper case alphabet.  These
  14. % last dimensions can be very useful for calculating the size of
  15. % close-fitting boxes and struts.
  16. %
  17. % Non-text fonts are displayed in table form only.
  18. %
  19. % If you have \TeX\ running with "plain.tex" loaded, 
  20. % you can start this macro by typing "tex fontbl" and you will be prompted
  21. % for the rest
  22. %
  23. \baselineskip 0pt \lineskip 0pt
  24. \vsize 8.5truein
  25. \let\sl=\tensl
  26. \newcount\bighand\newcount\littlehand
  27. \bighand=\time\divide\bighand by 60
  28. \littlehand=\bighand\multiply\littlehand by -60
  29. \advance\littlehand by\time
  30. \def\makedateline{\line{{\sl \fontname scaled \\magstep\step\hfil
  31.   \the\bighand:\ifnum\littlehand<10{0}\fi
  32.   \the\littlehand\ - \the\month/\the\day/\the\year}}}
  33.  
  34. \output{\shipout\vbox{\hrule width1em\vskip 1ex
  35. \makedateline\vskip1em\box255\vskip1em
  36. \hrule width1em}\global\advance\count0 by 1}
  37.  
  38. \newdimen\maxwide
  39. \dimendef\vu=\maxwide
  40. \setbox 9\hbox{\sl 0}
  41.  
  42. \def\spike{\hbox to 0pt{\vbox to 1\ht9{}}}
  43. \def\cell#1{\hbox to \vu{\hfill\char'#1\hfill}\vrule}
  44. \def\label#1{\vbox to 1\ht8{\vfill
  45.   \hbox to 35pt{\hfill\sl '#10\hskip1em}\vfill}\vrule}
  46.  
  47. \def\seprow{\def\m{\hskip \vu{}\vrule height 2pt}\hbox{\m\m\m\m\m\m\m\m}}
  48. \def\cellrow#1{\setbox 8\vbox{\seprow\hbox{\spike\ignorespaces
  49.                \cell{#10}\cell{#11}\cell{#12}\cell{#13}\ignorespaces
  50.                \cell{#14}\cell{#15}\cell{#16}\cell{#17}\ignorespaces
  51.                \hfill}\seprow\hrule}\hbox{\label{#1}\box8}}
  52.  
  53. \def\lcol#1{\hbox to \vu{\hfill{\sl #1}\hfill}\hskip .4pt}
  54. \def\chw#1{\hbox{\char'#1}}
  55.  
  56. \def\colw#1{\vbox{\chw{#10}
  57.                   \chw{#11}
  58.                   \chw{#12}
  59.                   \chw{#13}
  60.                   \chw{#14}
  61.                   \chw{#15}
  62.                   \chw{#16}                                              
  63.                   \chw{#17}}}
  64.  
  65. \def\setw#1{\vbox{\colw{#10}             
  66.                   \colw{#11}
  67.                   \colw{#12}
  68.                   \colw{#13}
  69.                   \colw{#14}
  70.                   \colw{#15}
  71.                   \colw{#16}
  72.                   \colw{#17}}}
  73. \def\getw{\setbox 0\vbox{\setw0\setw1\hbox to 1\wd9{}
  74.           \hbox to 1em{}}\vu=1.625\wd0}
  75.  
  76. \def\table#1{\font\tablefont=#1 scaled \scale
  77. \tablefont\getw\null\vfil
  78. \hbox to 6in{\hfil\ignorespaces
  79. \vbox{\ifdim\fontdimen2\tablefont>0pt \hbox{\hskip35pt \fontname \hfil} \fi 
  80.       \vskip10pt
  81.       \hbox{\hskip35pt\lcol0\lcol1\lcol2\lcol3\lcol4\lcol5\lcol6\lcol7}
  82.       \vskip 4 pt
  83.       \hbox{\hskip35pt\vbox{\hrule width 8\vu}\vbox{\hrule width 3.6pt}}
  84.       \cellrow{00}\cellrow{01}\cellrow{02}\cellrow{03}
  85.       \cellrow{04}\cellrow{05}\cellrow{06}\cellrow{07}
  86.       \cellrow{10}\cellrow{11}\cellrow{12}\cellrow{13}
  87.       \cellrow{14}\cellrow{15}\cellrow{16}\cellrow{17}}\ignorespaces
  88. \hss}}
  89. \def\tblraggedright{\rightskip0pt plus5em}
  90.  
  91. \global\def\test{}
  92. \global\def\fin{END }
  93. \global\def\lcfin{end }
  94. \global\def\halfstep{half }
  95. \def\\{$\backslash$}
  96. \def\doit{
  97. \baselineskip 0pt \lineskip 0pt 
  98. \message{Type a valid font name, or type END to quit :}
  99. \read16 to\fontname
  100. \ifx\fontname\lcfin\let\test=\fin\else\global\let\test=\fontname\fi
  101. \ifx \fin\test \relax 
  102. \else \message{Scaled to what magstep? (half, or 0..5):}
  103. \read16 to\step
  104. \ifx \halfstep\step \global\def\scale{1095 } \else 
  105.   \global\def\scale{\ifcase\step 1000\or 
  106.     1200\or 1440\or 1728\or 2074\or 2488\fi\relax}
  107.   \fi
  108. \message{Graphing font \fontname}
  109.        \table{\fontname}
  110. \rightskip 0pt % So that one ragged right font doesn't affect all
  111. %    following fonts
  112. \vskip 1em
  113. \ifdim\fontdimen2\tablefont>0pt
  114.   \setbox8=\hbox{abcdefghijklmnopqrstuvwxyz}
  115.   \setbox7=\hbox{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
  116.   \global\dimen8=1\wd8\global\dimen7=.5\hsize
  117.   \global\dimen5=1\ht8\global\dimen4=1\dp8\global\dimen3=1\ht7
  118.   \edef\length{\the\dimen8}
  119.   \global\dimen6=\dimen8\global\multiply\dimen6 by 3
  120.   \ifdim\dimen6>\hsize \global\dimen6=\hsize \fi
  121.   \ifdim\fontdimen3\tablefont=0pt \tblraggedright
  122.      \global\advance\dimen6 by -40pt \fi  
  123.   \vskip 1em
  124.   \noindent
  125.   \ifdim\dimen8<\dimen6 
  126.     \line{\unhbox8\hfil }
  127.     \vskip 1ex \fi
  128.   \centerline{{\rm Alphabet length \length. Quad is \the\fontdimen6\tablefont}}
  129.   \vskip .25em
  130.   \centerline{{\rm Lower case height is \the\dimen5 ; depth is \the\dimen4}}
  131.     \vskip 1em
  132.     \global\dimen8=1\wd7 \edef\length{\the\dimen8}
  133.     \noindent
  134.   \ifdim\dimen8<\dimen6 
  135.     \line{\unhbox7 \hfil}
  136.     \vskip 1ex  \fi
  137.     \centerline{{\rm Alphabet length \length ; height \the\dimen3}}
  138.   \vskip 1em \vfil
  139.   \vbox{\hsize \dimen6
  140.   \baselineskip 1.2em
  141.   \parskip .15em
  142.   \lineskip .2em
  143.  
  144. The design of low-resolution typefaces is complicated by the need 
  145. to achieve two different and rather incompatible ends.  A font which is
  146. exclusively intended for Office Automation equipment should be designed 
  147. to make the very best use of that environment.  Its proportions, balance,
  148. shading and letter-spacing can and indeed must be fitted to exact
  149. pixel-bound\-aries, whe\-ther or not the refinements of anti-aliasing are
  150. used.  
  151.  
  152. A low-resolution font which was created primarily as the proof-copy
  153. imitation of an associated high-resolu\-tion font will never be quite 
  154. so precisely matched to its environment.  Its contours will necessarily be
  155. determined by exact pixel-boundaries, but often not in the way we might
  156. prefer.  It need not be sloppy, but it can never be so well tuned as 
  157. a font of the first variety.  It is a poor Platonic reflection of an
  158. idea that cannot be fully known except in the dazzling light
  159. of high-resolution typesetting.  The vast majority of fonts produced
  160. with METAFONT belong to this second variety.  A low-resolution
  161. METAFONT character should be judged for what it is, and not for what
  162. it has never claimed to be.
  163. }
  164. \fi
  165.  
  166. \vfill\penalty-10000
  167.  
  168. \doit
  169. \fi
  170. }
  171.  
  172. \doit
  173. \bye
  174.